package com.example.demo.service.impl;

import com.example.demo.dao.PatternMapper;
import com.example.demo.modal.Pattern;
import com.example.demo.service.PatternService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PatternServiceImpl implements PatternService {
    @Autowired
    private PatternMapper patternMapper;

    @Override
    public int deleteByPrimaryKey(Integer rpId) {
        return patternMapper.deleteByPrimaryKey(rpId);
    }

    @Override
    public int insert(Pattern record) {
        return patternMapper.insert(record);
    }

    @Override
    public int selectMaxId(){
        return patternMapper.selectMaxId();
    };

    @Override
    public int updateByPrimaryKey(Pattern record) {
        return patternMapper.updateByPrimaryKey(record);
    }

    @Override
    public int save(Pattern pattern){
        return patternMapper.insert(pattern);
    }

    @Override
    public List<Pattern> selectAll() { return patternMapper.selectAll(); }

    @Override
    public List<Pattern> findByrpId(int rpId) { return patternMapper.selectByPrimaryKey(rpId); }

    @Override
    public List<Pattern> findByrpName(String rpName){
        return patternMapper.selectByRpName(rpName);
    };

    @Override
    public List<Pattern> findByrpRequir(String rpRequir){
        return patternMapper.selectByRpRequir(rpRequir);
    };

    @Override
    public List<Pattern> findByrpConclu(String rpConclu){
        return patternMapper.selectByRpConclu(rpConclu);
    };

    @Override
    public List<Pattern> findByrpRelationship(String rpRelationship){ return patternMapper.selectByRpRelationship(rpRelationship); };
    @Override
    public List<Pattern> findByrpConditions(String rpConditions){ return patternMapper.selectByRpConditions(rpConditions); };
}
